import {usePressureStore} from "../store/pressure";
const pressureStore = usePressureStore()
/**
 * 数据无法响应
 * */
// x轴时间
let time:Array<string> = []
// 压力高限
let pressureUp: Array<string> = []
// 当前值 （数据有误需要更改）
let currentValue: Array<string> = []
// 遍历添加
pressureStore.chartDataObj.forEach(item => {
    time.push(item.turnoverTime.slice(5))
    pressureUp.push(item.pressure)
    currentValue.push(item.oldPressure)
})
export let option = {
    title: {
        // text:`${pressureStore.chartDataObj[0].region ? pressureStore.chartDataObj[0].region : '撒拉嘿哟'} `,
        text: '嘻嘻嘻',
        x: 'center',
        y: 'bottom'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {},
    toolbox: {
        show: true,
        feature: {
            magicType: {type: ['line', 'bar']},
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: time
    },
    yAxis: {
        type: 'value',
    },
    series: [
        {
            name: '当前值',
            type: 'line',
            data: currentValue,
        },
        {
            name: '压力高限',
            type: 'line',
            data: pressureUp,
        }
    ],
};